/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.gps.service;

import pe.gps.record.Record;
import pe.gps.manager.ManagerPool;

/**
 *
 * @author romulogalindo
 */
public abstract class ServicioWR extends Servicio implements Runnable {

    String no_syswr = "WFACR";
    String co_subtype = "WR";
    //-------------------------------
    ManagerPool managerPool;
    //-------------------------------
    int status = 0;
    //----------------------
    int ca_minpool = 0;
    int ca_maxpool = 0;
    //----------------------
    int ca_poolsize = 10;
    //----------------------

    long ca_process;
    long ca_process_ok;
    long ca_process_wait;
    long ca_ps;
    //----------------------
    boolean il_status = true;

    public ServicioWR(String no_server, String no_syswr, int ca_inipool, int ca_maxpool, int ca_poolsize, String co_subtype) {
        this.no_server = no_server;
        this.no_syswr = no_syswr;
        this.ca_minpool = ca_inipool;
        this.ca_maxpool = ca_maxpool;
        this.ca_poolsize = ca_poolsize;
        this.co_subtype = co_subtype;
        this.co_type = "WR";
//        this.managerPool = new ManagerPool_DB(this.no_server, this.no_syswr, this.ca_minpool, this.ca_maxpoolsize);
//        this.managerPool = new ManagerPool_FILE(this.no_syswr, ca_inipool, ca_maxpoolsize);        
    }

    @Override
    public abstract void run();

    public String getNo_syswr() {
        return no_syswr;
    }

    public void setNo_syswr(String no_syswr) {
        this.no_syswr = no_syswr;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getCo_subtype() {
        return co_subtype;
    }

    public void setCo_subtype(String co_subtype) {
        this.co_subtype = co_subtype;
    }

    public long getCa_process() {
        return ca_process;
    }

    public long getCa_process_ok() {
        return ca_process_ok;
    }

    public long getCa_process_wait() {
        return ca_process_wait;
    }

    public long getCa_ps() {
        return ca_ps;
    }

    public void setCa_ps(long ca_ps) {
        this.ca_ps = ca_ps;
    }

    public int getCa_minpool() {
        return ca_minpool;
    }

    public ManagerPool getMpool() {
        return managerPool;
    }

    public abstract int getSizethread();

    public abstract boolean setRecord(Record record);

    public abstract void updateInfo();

    public static final int STATUS_LOADING = 0;
    public static final int STATUS_READY = 1;
    public static final int STATUS_ERROR = 2;
    public static final int STATUS_WAIT = 3;

}
